<!-- right-->
  <div class="MemberMain">
  <div style="height:auto">

 <div class="title"><{t}>我的订单<{/t}></div>

 <table class="gridlist" width="100%" border="0" cellspacing="0" cellpadding="0">
  <col class="span-6"></col >
    <col class="span-2"></col >
    <col class="span-2"></col >
     <col class="span-1"></col >
    <col class="span-2"></col >
     <col style="width:40px;"></col >
   <tr>
     <th><{t}>商品名称<{/t}></th>
     <th><{t}>订单号<{/t}></th>
     <th><{t}>下单日期<{/t}></th>
     <th><{t}>总金额<{/t}></th>
     <th><{t}>订单状态<{/t}></th>
     <th><{t}>操作<{/t}></th>
   </tr>
<tbody>
<{foreach from=$orders item="order" name=orders key="key"}>
<tr <{if ($key+1)%2 == 0}>class="order_list_tr"<{/if}>>
  <td width="40%">
	<{if $order.goods_items}>
	<{foreach from=$order.goods_items item=item_goods name=goods_item}>

	<dl <{if count($order.goods_items)>1&&end($order.goods_items)!=$item_goods}>class="bottomboder"<{/if}>>
		<dt>
		  <div class='product-list-img' isrc="<{$item_goods.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{link app=b2c ctl=site_product act="index" arg0=$item_goods.goods_id}>' style='width:50px;height:58px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
		</dt>
		<dd style="width:113px;" >
			<a target="_blank" href="<{link app=b2c ctl="site_product" act="index" arg0=$item_goods.goods_id}>">
				<{$item_goods.name}>
			</a>
			<{if $item_goods.attr}><br/>
				<span><{$item_goods.attr}></span>
			<{/if}>
		</dd>
		<dd style=" width:90px;font-weight:bold; float:left; text-align:center; ">
		  <ul>
			<li class="point"><{$item_goods.price|cur_odr:$order.currency}></li>
			<li>×<{$item_goods.quantity}></li>
		  </ul>
		</dd>
        <div style="height:1px; line-height:1px; clear:both"></div>
	</dl>
	<{/foreach}>
	<!-- adjunct -->
	<{if $item_goods.adjunct_items}>
	<{foreach from=$item_goods.adjunct_items item=item_adjunct name=adjunct_item}>
	<dl class="topborder">
		<dt>
		  <div class='product-list-img' isrc="<{$item_adjunct.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_adjunct.link_url}>' style='width:50px;height:58px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
		</dt>
		<dd style="width:113px;" >
			<a target="_blank" href="<{$item_adjunct.link_url}>">
				<{$item_adjunct.name}>
			</a>
			<{if $item_adjunct.attr}><br/>
				<span><{$item_adjunct.attr}></span>
			<{/if}>
		</dd>
		<dd style=" width:90px;font-weight:bold; float:left; text-align:center; ">
		  <ul>
			<li class="point"><{$item_adjunct.price|cur_odr:$order.currency}></li>
			<li>×<{$item_adjunct.quantity}></li>
		  </ul>
		</dd>
        <div style="height:1px; line-height:1px; clear:both"></div>
	</dl>
	<{/foreach}>
	<{/if}>
	<{if $item_goods.gift_items}>
	<{foreach from=$item_goods.gift_items item=item_gift name=gift_item}>
	<dl class="topborder">
		<dt>
		  <div class='product-list-img' isrc="<{$item_gift.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_gift.link_url}>' style='width:50px;height:58px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
		</dt>
		<dd style="width:113px;" >
			<a target="_blank" href="<{$item_gift.link_url}>">
				<{$item_gift.name}>
			</a>
			<{if $item_gift.attr}><br/>
				<span><{$item_gift.attr}></span>
			<{/if}>
		</dd>
		<dd style=" width:90px;font-weight:bold; float:left; text-align:center; ">
		  <ul>
			<li class="point"><{$item_gift.price|cur_odr:$order.currency}></li>
			<li>×<{$item_gift.quantity}></li>
		  </ul>
		</dd>
        <div style="height:1px; line-height:1px; clear:both"></div>
	</dl>
	<{/foreach}>
	<{/if}>
	<{/if}>
	<!-- gift -->
	<{if $order.gift_items}>
	<{foreach from=$order.gift_items item=item_gift name=gift_item}>
	<dl <{if count($order.gift_items)>1&&end($order.gift_items)!=$item_gift}>class="bottomboder"<{/if}>>
		<dt>
		  <div class='product-list-img' isrc="<{$item_gift.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$item_gift.link_url}>' style='width:50px;height:58px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
		</dt>
		<dd style=" width:55%" >
			<a target="_blank" href="<{$item_gift.link_url}>">
				<{$item_gift.name}>
			</a>
			<{if $item_gift.attr}><br/>
				<span><{$item_gift.attr}></span>
			<{/if}>
		</dd>
		<dd style=" padding:0 1px;font-weight:bold ">
		  <ul>
			<li class="point"><{$item_gift.price|cur_odr:$order.currency}></li>
			<li>×<{$item_gift.quantity}></li>
		  </ul>
		</dd>
        <div style="height:1px; line-height:1px; clear:both"></div>
	</dl>
	<{/foreach}>
	<{/if}>
	
	<!-- extends -->
	<{if $order.extends_items}>
	<{foreach from=$order.extends_items item=item_extends name=item_extends}>
	<{foreach from=$item_extends.info item=extend name=item}>
	<dl <{if count($item_extends.info )>1&&end($item_extends.info )!=$extend}>class="bottomboder"<{/if}>>
		<dt>
		  <div class='product-list-img' isrc="<{$extend.thumbnail_pic|default:$env.conf.site.default_thumbnail_pic|storager:'s'}>" ghref='<{$extend.link_url}>' style='width:50px;height:58px; margin:0 auto'> <img src='<{$res_url}>/loading.gif'/> </div>
		</dt>
		<dd style=" width:55%" >
			<a target="_blank" href="<{$extend.link_url}>">
				<{$extend.name}>
			</a>
			<{if $extend.attr}><br/>
				<span><{$extend.attr}></span>
			<{/if}>
		</dd>
		<dd style=" padding:0 1px;font-weight:bold ">
		  <ul>
			<li class="point"><{$extend.price|cur_odr:$order.currency}></li>
			<li>×<{$extend.quantity}></li>
		  </ul>
		</dd>
        <div style="height:1px; line-height:1px; clear:both"></div>
	</dl>
	<{/foreach}>
	<{/foreach}>
	<{/if}>
</td>
<td style="padding-top:13px"><{$order.order_id}></td>
  <!--<td  class="textwrap"><{$order.tostr}></td> -->
  <td style="padding-top:13px" ><{$order.createtime|cdate:FDATE_STIME}></td>
  <td style="padding-top:13px" class="point"><{$order.cur_amount|cur_odr:$order.currency:false:true}></td>
  <td style="padding-top:13px"><span>
  <{if $order.status == 'finish'}><{t}>已完成<{/t}>
  <{elseif $order.status == 'dead'}><{t}>已作废<{/t}>
  <{else}>
  <{if $order.pay_status==1}><{t}>已付款<{/t}>
    [<{if $order.ship_status==1}>
   <{t}> 已发货<{/t}>
    <{elseif $order.ship_status==2}>
    <{t}>部分发货<{/t}>
    <{elseif $order.ship_status==3}>
    <{t}>部分退货<{/t}>
    <{elseif $order.ship_status==4}>
    <{t}>已退货<{/t}>
    <{else}>
    <{t}>正在备货...<{/t}>
    <{/if}>]
  <{elseif $order.pay_status==2}>
    <{t}>已付款至担保方<{/t}>
  <{elseif $order.pay_status==3}>
    <{t}>待补款<{/t}>
    <{if $order.ship_status==1}>
    <{t}>[已发货]<{/t}>
    <{elseif $order.ship_status==2}>
   <{t}> [部分发货]<{/t}>
    <{elseif $order.ship_status==3}>
    <{t}>[部分退货]<{/t}>
    <{elseif $order.ship_status==4}>
    <{t}>[已退货]<{/t}>
    <{/if}>
  <{elseif $order.pay_status==4}>
   <{t}> 部分退款<{/t}>
    [<{if $order.ship_status==1}>
    <{t}>已发货<{/t}>
    <{elseif $order.ship_status==2}>
    <{t}>部分发货<{/t}>
    <{elseif $order.ship_status==4}>
    <{t}>已退货<{/t}>
    <{elseif $order.ship_status==0}>
    <{t}>未发货<{/t}>
    <{/if}>]
  <{elseif $order.pay_status==5}>
    <{t}>已退款<{/t}>
    [<{if $order.ship_status==1}>
    <{t}>已发货<{/t}>
    <{elseif $order.ship_status==2}>
    <{t}>部分发货<{/t}>
    <{elseif $order.ship_status==4}>
   <{t}> 已退货<{/t}>
    <{elseif $order.ship_status==0}>
    <{t}>未发货<{/t}>
    <{/if}>]
  <{else}>
    <{t}>待付款<{/t}></a>
    <{if $order.ship_status==1}>
    <{t}>[已发货]<{/t}>
    <{elseif $order.ship_status==2}>
    <{t}>[部分发货]<{/t}>
    <{elseif $order.ship_status==3}>
    <{t}>[部分退货]<{/t}>
    <{elseif $order.ship_status==4}>
    <{t}>[已退货]<{/t}>
    <{/if}>
  <{/if}>
  <{/if}>
  </span></td>
  <td style="padding-top:13px"><{if $order.pay_status=='0' || $order.pay_status=='3'}><{if $order.payinfo.pay_app_id != '-1'}><a href="<{link app=b2c ctl="site_member" act="orderPayments" arg0=$order.order_id}>" ><{/if}><{t}>去付款<{/t}><{if $order.payinfo.pay_app_id != '-1'}></a><{/if}><br /><{/if}><a href="<{link app=b2c ctl="site_member" act="orderdetail" arg0=$order.order_id}>"><{t}>查看订单<{/t}></a></td>
</tr>
<{/foreach}>
</tbody>
 </table>
 <{pagers data=$pager}>
  </div>
  </div>
  <!-- right-->

<script>
/*小图mouseenter效果*/
window.addEvent('domready',function(){

  var cart_product_img_viewer=new Element('div',{styles:{'position':'absolute','zIndex':500,'opacity':0,'border':'1px #666 solid'}}).inject(document.body);

  var cpiv_show=function(img,event){

      if(!img)return;
      cart_product_img_viewer.empty().adopt($(img).clone().removeProperties('width','height').setStyle('border','1px #fff solid')).fade(1);

      var size = window.getSize(), scroll = window.getScroll();
        var tip = {x: cart_product_img_viewer.offsetWidth, y: cart_product_img_viewer.offsetHeight};
        var props = {x: 'left', y: 'top'};
        for (var z in props){
            var pos = event.page[z] + 10;
            if ((pos + tip[z] - scroll[z]) > size[z]) pos = event.page[z] - 10 - tip[z];
            cart_product_img_viewer.setStyle(props[z], pos);
        }

  };

   $$('.gridlist .product-list-img').each(function(i){

       new Asset.image(i.get('isrc'),{onload:function(img){
	   if(!img)return;
           var _img=img.zoomImg(50,50);
		     if(!_img)return;
           _img.setStyle('cursor','pointer').addEvents({
              'mouseenter':function(e){
                 cpiv_show(_img,e);
              },
              'mouseleave':function(e){
                cart_product_img_viewer.fade(0);
              }
           });
           i.empty().adopt(new Element('a',{href:i.get('ghref'),target:'_blank',styles:{border:0}}).adopt(_img));
       },onerror:function(){
            i.empty();

       }});

   });

});
</script>
